<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <input type="button" value="点击" @click="doIt('你好',2)">
        <!-- 输入一个就弹出 -->
        <input type="text" @keyup="sayHi">
        <!-- 回车弹出 -->
        <input type="text" @keyup.enter="sayHi">
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

    <script>
        var vue = new Vue({
            el:"#app",
            data:{
                message:"ABC"
            },
            methods:{
                doIt:function(p1,p2){
                    alert(p1+p2)
                },
                sayHi:function(){
                    alert("hi")
                }   
            }
        })
    </script>
</body>
</html>